package net.xyuu.config;

import javax.validation.Validator;

import org.springframework.cache.CacheManager;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

@Configuration
public class AppConfig {

	@Bean
	public CacheManager cacheManager() {
		return new ConcurrentMapCacheManager("acl");
	}

	@Bean
	public SecurityConfig applicationSecurity() {
		return new SecurityConfig();
	}

	@Bean
	public Validator validator() {
		return new LocalValidatorFactoryBean();
	}
}
